package com.wl.mvi.home.ui

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.bumptech.glide.Glide
import com.wl.mvi.databinding.ItemBannerBinding
import com.wl.mvi.home.model.bean.Banner


// Created by wangliang on 2024/5/6.
class BannerItemView @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {

    private val binding = ItemBannerBinding.inflate(LayoutInflater.from(context), this)

    fun render(item: Banner) {
        Glide.with(binding.bannerIv.context).load(item.imagePath).into(binding.bannerIv)
    }
}